package com.rika.service.impl;

import com.rika.dao.ProductDao;
import com.rika.pojo.Product;
import com.rika.service.ProductService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class ProductServiceImpl implements ProductService {
    @Resource
    private ProductDao productDao;
    @Override
    public List<Product> selectAllProduct(Map<String, Object> params) {
        return productDao.selectAllProduct(params);
    }

    @Override
    public Integer countAll() {
        return productDao.countAll();
    }

    @Override
    public void addProduct(Product product) {
        productDao.addProduct(product);
    }

    @Override
    public void deleteProduct(String productCode) {
        productDao.deleteProduct(productCode);
    }

    @Override
    public List<Product> selectByProductCode(String productCode) {
        return productDao.selectByProductCode(productCode);
    }

    @Override
    public List<Integer> selectCategoryByProductCode(String productCode) {
        return productDao.selectCategoryByProductCode(productCode);
    }

    @Override
    public void updateProduct(Product product) {
        productDao.updateProduct(product);
    }

    @Override
    public List<Product> selectAllProductForPo() {
        return productDao.selectAllProductForPo();
    }

    @Override
    public Product selectByName(String name) {
        return productDao.selectByName(name);
    }

    @Override
    public void updateproductInStore(Map<String, Object> params) {
        productDao.updateproductInStore(params);
    }

    @Override
    public void updateProductWhenAddPoMain(Map<String, Object> params) {
        productDao.updateProductWhenAddPoMain(params);
    }

    @Override
    public void updateproductOutStore(Map<String, Object> params) {
        productDao.updateproductOutStore(params);
    }

    @Override
    public List<Product> selectProductForStore(Map<String, Object> params) {
        return productDao.selectProductForStore(params);
    }

    @Override
    public List<Product> selectProductForStockRecord(Map<String, Object> params) {
        return productDao.selectProductForStockRecord(params);
    }

    @Override
    public List<Product> selectProductReport(Map<String, Object> params) {
        return productDao.selectProductReport(params);
    }
}
